/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * leafget
 * Copyright (C) xinliGG 2008 <xinliGG@gmail.com>
 * 
 * leafget is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * leafget is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _UTIL_H_
#define _UTIL_H_

class Util
{
public:
		Util();
		virtual ~Util(){};
			
			
			/* converter functions */

		static const std::string itoa        ( const int & );
		static const std::string dtoa        ( const double & );

			/* file functions */

		static const long        get_file_size     ( std::ifstream * );

			/* show functions */

		static const std::string converter_human_size   ( const int & );
		static const std::string get_speed  ( const int & );
		static const std::string get_time   ( const int & );

			/* log functions */

		static void              set_logPath ( const std::string & );
		static void              msg_out     ( const std::string & );
		static void              msg_err     ( const std::string & );
		static void              check_log   ( void );

		static void              write_to_log   ( const std::string & );

protected:

private:

};

#endif // _UTIL_H_
